package FileManager;

import java.awt.Color;
import java.awt.Component;
import java.util.HashMap;
import java.util.Map;

import javax.swing.*;
import javax.swing.plaf.basic.BasicIconFactory;
import javax.swing.plaf.metal.MetalIconFactory;
import javax.swing.table.DefaultTableCellRenderer;

public class IconListRenderer
	extends DefaultTableCellRenderer {

	private Map<Object, Icon> icons = null;

	public IconListRenderer(Map<Object, Icon> icons) {
		this.icons = icons;
	}

	@Override
	public Component getTableCellRendererComponent(JTable table, Object value,boolean isSelected, boolean hasFocus, 
                                                       int row, int column) {

		Icon icon = icons.get(value);
		setText((String)value);
                setIcon(icon);
                setEnabled(true);
                setFocusable(true);
                setOpaque(true);
                setBackground(Color.WHITE);
                
		return this;
	}

	public static void main(String[] args) {

	
	}

}
